import { defineStore } from "pinia";

export interface AccidentTableList {
  accidentPageInfoShow : boolean;
  accidentPageInfoList : AccidentPageInfoList[];
  daDuiShiGuShuShow:boolean;
  daDuiShiGuShuName:string
  daDuiShiGuShuList1:AccidentPageInfoList[];
  daDuiShiGuShuList2:AccidentPageInfoList[]
  shiGuGaoFaLuDuanShow:boolean;
  shiGuGaoFaLuDuanName:string;
  shiGuGaoFaLuDuanList:AccidentPageInfoList[];
}

interface AccidentPageInfoList {
  sgbh:string;
  xzqh:string;
  sgfssj:String;
  lh:String;
  lm:String;
  gls:null;
  ms:any;
  sgdd:String;
  sgrdyy:any;
  swrs:any;
  ssrs:any;
  zjccss:any;
  sglx:string;
}

const useAccidentTableList = defineStore("AccidentTableList", {
  state: (): AccidentTableList => {
    return {
      accidentPageInfoShow: false,
      accidentPageInfoList: [],
      daDuiShiGuShuShow: false,
      daDuiShiGuShuName: '',
      daDuiShiGuShuList1: [],
      daDuiShiGuShuList2: [],
      shiGuGaoFaLuDuanShow:false,
      shiGuGaoFaLuDuanName:'',
      shiGuGaoFaLuDuanList:[],
    }
  },
  actions: {
    setState(newVlaue,data) {
      this.accidentPageInfoShow = newVlaue;
      this.accidentPageInfoList = data;
    },
    setDaDuiShiGuShu(newVlaue,name,data1,data2){
      this.daDuiShiGuShuName = name
      this.daDuiShiGuShuShow = newVlaue
      this.daDuiShiGuShuList1 = data1
      this.daDuiShiGuShuList2 = data2
    },
    setShiGuGaoFaLuDuan(newVlaue,name,data){
      this.shiGuGaoFaLuDuanShow = newVlaue
      this.shiGuGaoFaLuDuanName = name
      this.shiGuGaoFaLuDuanList = data
    }
  }
})

export default useAccidentTableList;
